When the Computer Says QED

iMathLab · SWIM 2026 · Zoom
When the Computer
Says QED
A Friendly Introduction to the Lean Theorem Prover
Marly Gotti
theorem two_plus_two : 2 + 2 = 4 := rfl
-- it compiles. it’s a theorem.
iMath-Lab.com

Three days ago…

Cold open

On August 1, 2026, OpenAI unveiled a model called Astra — by publishing solutions to six decade-old open math problems.

  • Not blog-post claims. Each solution shipped with a machine-checkable certificate.
  • The certificates are written in a language called Lean 4, posted publicly on GitHub.
  • Anyone — you, tonight — can run the checker and confirm every step.

The trust layer under this story is the subject of tonight’s talk.

How do you know a proof is right?

The doubt

  • Everyone in this room proves things — about atoms, factorizations, Puiseux monoids.
  • Referees are human. They miss things. Some proofs run hundreds of pages.
  • Every mathematician knows that 2am-fear: “wait… is my Lemma 3 actually true?”
  • Ever handed a proof to a mentor and just… hoped it survives?
  • Applied project? Your version is the silent bugsame fear, different costume.

The proof nobody could check

The doubt

2012. Shinichi Mochizuki posts a proof of the famous abc conjecture — more than 500 pages of entirely new machinery.

For six years, the mathematical world cannot decide whether it is correct.

2018. Peter Scholze and Jakob Stix travel to Kyoto — and conclude that one crucial step does not hold. Mochizuki insists it does.

The deadlock stands to this day. Human refereeing hit its ceiling.

December 2020

The doubt comes home

Peter Scholze proves what he calls possibly the most important theorem of his career — and it rests on one monstrous lemma.

He is not fully certain of it. And he knows better than anyone where unresolved doubt leads.

So he says the doubt out loud — and dares the world to check him.

Not a committee. Not a referee. He asked a machine.

July 14, 2022

Eighteen months later

…AND THE MACHINE SAID YES.

The Liquid Tensor Experiment — led by Johan Commelin, with Adam Topaz and a volunteer team — finished checking the full proof.

  • Every step verified. Scholze’s doubt: gone.
  • It checked exactly the part he was most worried about.
  • The tool they used is called Lean.

The one idea of this talk

Hold onto this

A proof is a program.

Checking a proof is compiling it.

If it compiles, it’s true.

Roadmap

  1. What Lean feels like
  2. Under the hood — and a live demo
  3. The library of everything
  4. What crowds can do
  5. The AI plot twist
  6. Your math, in motion
  7. Your first move — tonight

What Lean Feels Like

What is a proof assistant?

Meet Lean

A programming language where the statements are theorems and the programs are proofs — checked by an infinitely patient, extremely picky referee.

  • Created in 2013 by Leonardo de Moura (then Microsoft Research, now AWS).
  • Current version: Lean 4 — a real, fast programming language.
  • Since 2023: backed by its own dedicated nonprofit, whose full-time job is usability, documentation, and proof automation.

Your first theorem

Taste of Lean

theorem two_plus_two : 2 + 2 = 4 := rfl
  • two_plus_two — the name.
  • 2 + 2 = 4 — the statement.
  • rfl — the proof: “true by computation.”
  • That’s the entire file. No imports. It compiles. It’s a theorem.

What happens when you lie

Taste of Lean

  • Lean is not a search engine. Not a chatbot. Not “pretty confident.”
  • It is incapable of accepting a false step.
  • No “clearly.” No “trivially.” No hand-waving. Ever.

One honest caveat: Lean checks the proof of the statement you wrote. Stating the right theorem is still your job.

A proof with actual content

Taste of Lean

example (a b : Nat) :
    a + b = b + a := by
  induction b with
  | zero => simp
  | succ n ih =>
      rw [Nat.add_succ, ih,
          Nat.succ_add]
-- the goal window (sketch) --
case zero
⊢ a + 0 = 0 + a        ✓ simp

case succ
ih : a + n = n + a
⊢ a + (n+1) = (n+1) + a
  rw [Nat.add_succ] ↦
⊢ (a + n) + 1 = (n+1) + a
  rw [ih] ↦
⊢ (n + a) + 1 = (n+1) + a
  rw [Nat.succ_add] ↦  ✓
  • induction, simp, rw are tactics: proof moves. The goal window is a blackboard that updates itself.

The most honest word in mathematics

Taste of Lean

theorem my_big_lemma : ∀ n : Nat, n + 0 = n := by
  sorry
  • sorry = “I’ll prove this later.” Lean accepts it — with a loud warning.
  • It’s how you sketch a big proof: state everything, sorry the gaps, fill them one by one.
  • The gold standard of done: sorry-free.
  • Remember Astra’s certificates? Sorry-free Lean proofs. Now you know what that means.
  • Zero sorries. Nothing owed. Nowhere left for that 2am-fear to live.

Under the Hood

How the checking actually works

Under the hood

  • You write tactics; Lean’s elaborator turns your moves into a proof term — an actual, fully written-out program.
  • The statement is a type; the proof term is a program of that type. That’s “proof = program,” made literal.
  • A small, deliberately isolated kernel — a tiny fraction of the system — re-checks every proof term from scratch, against the rules of dependent type theory.
  • You never trust the 2M-line library, the tactics, or the AI that drafted the proof. You trust the tiny kernel. Independent checkers can re-verify its verdicts.

Caveats — what “verified” doesn’t mean

Under the hood

  • Lean certifies the proof of the statement you wrote. Mis-state the theorem → a flawless proof of the wrong thing.
  • Definitions must match intent. Is your formal “atomic monoid” the atomic monoid? A human still reads the definitions.
  • You still trust something: the kernel — and the axioms you opt into (e.g. classical logic). Lean will list them for any theorem.
  • Verified ≠ illuminating. A compiled proof can still be unreadable. Insight stays our job.

Limitations — what it still costs

Under the hood

  • Formalizing is slow. A page of paper math is usually many pages of Lean — and “obvious” steps are often the most expensive.
  • The library is uneven. Astonishingly deep in places; blank in whole research areas.
  • The learning curve is real. Comfort takes weeks of play, not one evening — that’s why this talk ends with an on-ramp.
  • AI has entered research mathematics. Humans still frame problems, audit definitions, and validate novelty and significance.

Let’s prove one, live

No slides for two minutes — real Lean

Compute · automate · use the library — backup script in the appendix.

The Library of Everything

You don’t start from axioms alone

mathlib

mathlib — the community’s single, unified library of formalized mathematics.

  • 283,802 theorems
  • 134,897 definitions
  • Over 2 million lines of Lean
  • 772 contributors
  • Built mostly by volunteers
  • One library — not scattered papers

Theorems you already know, on demand

mathlib

import Mathlib

#check Nat.exists_infinite_primes   -- ∀ n : ℕ, ∃ p, n ≤ p ∧ p.Prime
#check irrational_sqrt_two          -- Irrational √2

Euclid and the Pythagoreans. One import. One line each.

mathlib speaks this group’s language

Your objects, formally

-- faithful to mathlib4
structure Irreducible [Monoid M] (p : M) : Prop where
  not_isUnit : ¬IsUnit p
  isUnit_or_isUnit : ∀ a b, p = a * b → IsUnit a ∨ IsUnit b

[Monoid M] simply reads: “assuming M is a monoid.”

  • Not a unit; any factorization p = a * b forces a unit. That is the definition of an atom from your factorization-theory papers.
  • There’s AddIrreducible too — for additively written monoids. Hello, semidomains.
  • Prime, Associated, Associates — the prime-vs-irreducible distinction this audience lives on is baked into the library’s bones.

The punchline definition

Your objects, formally

UFM = cancellative + ACCP + (irreducible ↔︎ prime).

That is your field’s formulation — and it is mathlib’s official definition:

class UniqueFactorizationMonoid (α : Type*) [CommMonoidWithZero α] : Prop
    extends IsCancelMulZero α, IsWellFounded α DvdNotUnit where
  irreducible_iff_prime {a : α} : Irreducible a ↔ Prime a
  • IsCancelMulZerocancellative · IsWellFounded α DvdNotUnitACCP · the field → atoms are prime
  • mathlib refactored unique factorization into exactly the factorization-theorist’s viewpoint. Your field’s lens won.

What Crowds Can Do

Formalization at research speed

Landmark: PFR

Marton’s conjecture (Polynomial Freiman–Ruzsa):

  • Nov 9, 2023 — Gowers, Green, Manners, Tao post the proof.
  • Tao launches a crowdsourced Lean formalization, with Yael Dillies and Bhavik Mehta.
  • Dec 5, 2023“no sorrys.” About three weeks, paper to machine-checked.

Liquid Tensor Experiment: 18 months (2022) → PFR: 26 days (2023).

Sometimes the crowd is the theorem

Landmark: Equational Theories

Tao’s Equational Theories Project: for magmas — one set, one binary operation, this crowd’s home turf

  • 4,694 equational laws. 22,028,942 implications between them.
  • Every single one settled — humans + automation; primary goal completed Apr 14, 2025, final report on arXiv Dec 2025.
  • 50+ contributors, with genuine room for beginners.

And the long game

Landmark: FLT

Kevin Buzzard’s Fermat’s Last Theorem project (Imperial College London):

  • Formalizing a 21st-century proof — not Wiles’s original.
  • Funded by a UK national research grant through September 2029. Contributor workshop in London last month.
  • A proof so big no single person will ever check it by hand — exactly why we’re building the machine that can.

The AI Plot Twist

AI’s problem, Lean’s superpower

LLMs draft, Lean checks

Language models are fluent, confident — and sometimes wrong.

  • Oct 2025: OpenAI’s Kevin Weil announces GPT-5 “solved” 10 open Erdős problems…
  • …but existing papers already contained the mathematics.
  • Demis Hassabis: “embarrassing.”
  • The mathematics was sound; the novelty claim was not.
  • Lean checks a formal argument. It does not certify novelty or search the literature.

2024: the machine enters the IMO

LLMs draft, Lean checks

DeepMind’s AlphaProof + AlphaGeometry 2 system at IMO 2024 — the first AI system to reach medal level:

  • Combined result: 4/6 problems, 28/42 points — one point below the gold cutoff.
  • AlphaProof solved P1, P2, and P6, the hardest; AlphaGeometry 2 solved P4.
  • AlphaProof trained AlphaZero-style, with Lean as the referee: only kernel-checked proofs count.
  • Important caveats: humans translated the problems into Lean; some solutions took ~3 days of compute.

One year later

LLMs draft, Lean checks

IMO 2025:

  • Gemini Deep Think: official gold, 35/42, in natural language, within the time limit.
  • Harmonic’s Aristotle: 5/6 with Lean-verified proofs — no human grading needed.
  • And the slope: undergrad competition problems (the Putnam) went from nearly untouched (2024) to ~88% solved (late 2025).

Eighteen months. That’s the slope we’re on.

Correctness is not novelty

Lean checks proofs · people check context

Oct 2025 — literature miss

GPT-5 surfaces correct mathematics for 10 catalogued Erdős problems…

Prior papers already existed.

Jan 2026 — verified rediscovery

GPT-5.2 independently rediscovers a valid disproof of Erdős #397; Aristotle formalizes it in Lean.

A complete 2012 China TST solution is then found.

  • Lean verifies the formal argument — not novelty or literature precedence.
  • Trustworthy AI mathematics needs both: machine-checked correctness and expert statement and literature review.

Your Math, In Motion

This story is already inside SWIM

Aug 11 · mark your calendar

Next week, in this same Zoom room:

“Finitely Generated Semidomains: Formalization and a Conjecture” — Jonathan Liu, Jason Yang, Alan Yao (MIT CMI students), Tuesday Aug 11.

  • Fun fact: “semidomain” doesn’t exist in mathlib… yet.
  • The people building it are in this workshop — fresh off the bi-UFS positive semidomains paper (arXiv:2607.22941).
  • Come to that talk with tonight’s eyes.

Your objects, at the frontier

Closest to home

February 2026: Fel’s conjecture on syzygies of numerical semigroups (Chen, Lau, Ono, Zhang, et al.)

  • A conjecture about numerical semigroups — this community’s bread and butter.
  • The proof was fully formalized in Lean
  • … and the formalization was generated automatically by AxiomProver from the English statement of the theorem.

“Syzygies” is a technical invariant — the word doesn’t matter tonight. The objects — numerical semigroups — are yours.

Who’s going to change that?

Your math, in motion

Some but not all… yet.

  • The formalization of this territory is being carried out by CMI students.
  • The bulk of the work happens next CMI semester — your field will appear in mathlib, definition by definition, theorem by theorem.
  • Aug 11 is the first installment: finitely generated semidomains, in this Zoom room.

Learn the language now — you’ll want to read what’s coming.

Your First Move

Your on-ramp, in order

Start tonight

  1. Tonight — the Natural Number Game: adam.math.hhu.de · 79 levels, in your browser, zero install. You’ll re-prove a + b = b + a yourself before bed.
  2. This weekGlimpse of Lean (Patrick Massot): a 2–3 hour guided tour.
  3. This monthMathematics in Lean, the standard textbook. Experiment freely at live.lean-lang.org.
  4. Always — the Lean Zulip chat: famously kind to newcomers. Ask anything.
  5. Aug 11 — show up to the semidomains talk with new eyes.

The last thing

Closing

Remember that 2am-fear?

  • Every proof that gets formalized is a proof no one — not you, not a referee, not history — ever has to doubt again.
  • Astra’s certificates are public on GitHub: clone the repo, run the checker, and watch a formalized research result verify on your laptop.
  • Your field is about to get bigger online — the CMI effort starts in earnest next semester. Be ready to read it.
  • Go learn the language.

Announcing: Lean, Your Move — the newest course in the iMathLab series: the foundations of Lean, from the ground up. Details soon at imath-lab.com.

Questions?

Thank you · SWIM 2026
Questions?
Reach out!
Marly Gotti
marlygotti@imath-lab.com
iMath-Lab.com

Appendix: the live-demo script

Backup — only if the embedded editor won’t load

import Mathlib

#eval 2 + 2                         -- Lean computes: 4

example (a b : Nat) : a + b + 0 = b + a := by
  omega                             -- automation closes it

#check irrational_sqrt_two          -- Irrational √2
example : Irrational (Real.sqrt 2) := irrational_sqrt_two